import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import Find from '@/views/Find'
import Zixun from '@/views/Zixun'
import Myself from '@/views/Myself'
import Login from '@/views/Login'
import Notexist from '@/views/Notexist'
import Favorate from '@/views/Favorate'
import Rent from '@/views/Rent'
import Add from '@/views/Add'
import Search from '@/views/Search'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '',
        component: Home
      },
      {
        path: '/find',
        component: Find
      },
      {
        path: '/zixun',
        component: Zixun
      },
      {
        path: '/myself',
        component: Myself
      }
    ]
  },
  {
    path: '/login',
    component: Login

  },
  {
    path: '*',
    component: Notexist
  },
  {
    path: '/favorate',
    component: Favorate
  },
  {
    path: '/rent',
    component: Rent
  },
  {
    path: '/rent/add',
    component: Add
  },
  {
    path: '/rent/search',
    component: Search
  }

]

const router = new VueRouter({
  routes
})

export default router
